Repository navigation
digest: register SHAKE-128 - #520
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Shared cryptographic state-machine changes warrant human review and runtime validation across supported OpenSSL, wolfSSL, and FIPS configurations.
No open issues 🎉
What changed in this PR
Exposes SHAKE-128 through wolfProvider to address the missing digest reported in #434, and updates shared SHAKE behavior for newer OpenSSL APIs.
Changes:
- Registers SHAKE-128 with feature gating, aliases, and documentation.
- Adds incremental squeezing and OpenSSL 3.4 output-length behavior for both SHAKE variants.
- Expands default-provider parity tests and enables SHAKE-128 test vectors.
| File | Description |
|---|---|
test/unit.h |
Declares the SHAKE-128 unit test. |
test/unit.c |
Registers the SHAKE-128 unit test. |
test/test_digest.c |
Tests SHAKE parity, squeezing, lifecycle, and context copying. |
src/wp_wolfprov.c |
Registers SHAKE-128 in the provider digest table. |
src/wp_digests.c |
Implements SHAKE-128 and shared SHAKE state and output handling. |
scripts/evp_test/evpmd_sha.txt |
Enables SHAKE-128 digest vectors. |
README.md |
Lists SHAKE-128 as supported. |
include/wolfprovider/settings.h |
Gates SHAKE-128 on wolfSSL version and features. |
include/wolfprovider/alg_funcs.h |
Adds SHAKE-128 aliases and dispatch declaration. |
Review effort: Balanced
9bf6dd0 to
95ea338
Compare
Add the squeeze call OpenSSL 3.3+ uses (ML-KEM, ML-DSA) and match the default provider's output length handling: no default length or digest size from 3.4, xoflen/size readable from the context. Mark the AlgorithmIdentifier parameters absent; no absorbing after output starts.
wolfCrypt builds with WOLFSSL_SHAKE128 but only SHAKE-256 was exposed, so SHAKE-128 fetches (openssl dgst -shake128, Python hashlib) failed. Reuse the SHAKE-256 XOF code with the wc_Shake128 functions.
Mirror test_shake_256 for SHAKE-128 and compare default length final, squeeze across block boundaries and flags with OpenSSL for both SHAKEs. Enable the SHAKE128 evp_test vectors.
95ea338 to
be7b819
Compare
|
@claude review |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #520
Scan targets checked: wolfprovider-src, wolfprovider-bugs
Not reviewed (no scan target covers them): README.md, scripts/evp_test/evpmd_sha.txt, test/unit.h
Coverage: 4 of 6 in-scope changed file(s) opened by the reviewer; not opened: include/wolfprovider/alg_funcs.h, test/unit.c
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Max
wolfCrypt has SHAKE-128 but only SHAKE-256 was exposed, so in replace-default mode Python's
import hashliblogs a traceback,hashlib.shake_128is missing andopenssl dgst -shake128fails. Registers SHAKE-128 (wolfSSL 5.5.1+; FIPS v5 has no SHAKE, FIPS Ready does), addsEVP_DigestSqueeze(OpenSSL 3.3+, used by ML-KEM/ML-DSA) and OpenSSL 3.4's no-default-length rule for both SHAKEs, and enables the SHAKE128 evp_test vectors. Covered by unit tests comparing against the default provider.Closes #434.